<?php

//xdebug_start_code_coverage(XDEBUG_CC_UNUSED|XDEBUG_CC_DEAD_CODE);

foreach (glob(dirname(__file__).'/test-*.php') as $filename) {
    echo "\r\n\r\n===============[ $filename ]====================\r\n\r\n";
    include 'test-00-inc.php';
    include_once $filename;
}

$markers = array (-2 => 'o', -1 => '-', 1 => '+');
foreach (xdebug_get_code_coverage() as $filename => $data) {
    if (!file_exists($filename)) continue;
    $lines = file($filename);
    echo "\r\n\r\n===============[ $filename ]====================\r\n\r\n";
    foreach ($lines as $n => $line) {
        $n++; $s = '';
        if (array_key_exists($n, $data)) {
            if (($m = $data[$n]) > 1) $m = 1;
            $s = $markers[$m];
        }
        echo "$s\t$line";
    }
}
